{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "Fine-tune the Perceiver for image classification.ipynb",
      "provenance": [],
      "collapsed_sections": [],
      "authorship_tag": "ABX9TyPls53F6RxZItW9/8GuFLxQ",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "accelerator": "GPU",
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "770a106a490f4725a21eedc8f7e45405": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_e785dba574de44b5bfb592dbb579d6ff",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_e58da15de3ec444581b19a238581482b",
              "IPY_MODEL_c3356fc067854f80b6c348321cd40903",
              "IPY_MODEL_25b6ebb9dd134d468a12ab68397e403c"
            ]
          }
        },
        "e785dba574de44b5bfb592dbb579d6ff": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "e58da15de3ec444581b19a238581482b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_b97132e5502f4a57848e50450a0a4beb",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "Downloading: ",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_9cb91cbce0154dce98e7fa6b75abb8de"
          }
        },
        "c3356fc067854f80b6c348321cd40903": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_1b87dae262ed418b89b24cbd467966ff",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 1552,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 1552,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_bba8ba7e0bcf485287d6ef0388bc57a6"
          }
        },
        "25b6ebb9dd134d468a12ab68397e403c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_aadeaaedbd784ba58ca32891812e3508",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 3.63k/? [00:00&lt;00:00, 67.8kB/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_24d991b2c27f43e9a2150be8eafc8640"
          }
        },
        "b97132e5502f4a57848e50450a0a4beb": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "9cb91cbce0154dce98e7fa6b75abb8de": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "1b87dae262ed418b89b24cbd467966ff": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "bba8ba7e0bcf485287d6ef0388bc57a6": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "aadeaaedbd784ba58ca32891812e3508": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "24d991b2c27f43e9a2150be8eafc8640": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "b958aa8c5d814d6b8c46939692ece060": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_5212006a87084ee1a19027cc0ce685f3",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_59016efe4b954651925dd091cf2665f6",
              "IPY_MODEL_68346f8cf24b4369be76241cd83d3acf",
              "IPY_MODEL_6a9eff7147ea4b058c97bfd5e5d4a595"
            ]
          }
        },
        "5212006a87084ee1a19027cc0ce685f3": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "59016efe4b954651925dd091cf2665f6": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_d4717be36e3a4637afb2846f34b7774b",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "Downloading: ",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_77b214275fb94023bb553a73f67a98d0"
          }
        },
        "68346f8cf24b4369be76241cd83d3acf": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_7030c8c403a94c66a35d0e97a796a772",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 799,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 799,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_51e775c014b84048919b4ab67e735f7b"
          }
        },
        "6a9eff7147ea4b058c97bfd5e5d4a595": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_ef54be240c00421582752d225a0954ea",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 1.66k/? [00:00&lt;00:00, 13.5kB/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_790f2199d4424bc0867458d51a82b658"
          }
        },
        "d4717be36e3a4637afb2846f34b7774b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "77b214275fb94023bb553a73f67a98d0": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "7030c8c403a94c66a35d0e97a796a772": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "51e775c014b84048919b4ab67e735f7b": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "ef54be240c00421582752d225a0954ea": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "790f2199d4424bc0867458d51a82b658": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "7e104651b85743a29f9950bbfeaa625a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_3ab85dba0ded4c17848bd92fc4020622",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_4fd75dae213f4111a1e6ff0f4691d9e5",
              "IPY_MODEL_5791f085865f456aa48fb955c39b263f",
              "IPY_MODEL_f11ace7da9f84397874ba76d6240e7e5"
            ]
          }
        },
        "3ab85dba0ded4c17848bd92fc4020622": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "4fd75dae213f4111a1e6ff0f4691d9e5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_b8576770cf6f4525aec2a48eb32fd2f9",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "Downloading: 100%",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_0e8cfb4155cf4f43a24f5d3f1b2e68fd"
          }
        },
        "5791f085865f456aa48fb955c39b263f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_feba1fc9283649c998dd99387c255119",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 170498071,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 170498071,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_5b7da64698264b9987d0fd02c5114977"
          }
        },
        "f11ace7da9f84397874ba76d6240e7e5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_439d664b873240b98e2850ce20102d0f",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 170M/170M [00:06&lt;00:00, 31.7MB/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_ed947e965a584eb79ad05a77579a19f5"
          }
        },
        "b8576770cf6f4525aec2a48eb32fd2f9": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "0e8cfb4155cf4f43a24f5d3f1b2e68fd": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "feba1fc9283649c998dd99387c255119": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "5b7da64698264b9987d0fd02c5114977": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "439d664b873240b98e2850ce20102d0f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "ed947e965a584eb79ad05a77579a19f5": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "7feab8f71b864c07be8d5852cdec0951": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_e321fa1ddeea4522a17c2dc812cbbb8a",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_7c572d2aa86e4a7e962a3ab77f7a8273",
              "IPY_MODEL_eacc536b63f2400a9c4f6be177091392",
              "IPY_MODEL_9ca3ad6866da44dba367f66d270833d0"
            ]
          }
        },
        "e321fa1ddeea4522a17c2dc812cbbb8a": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "7c572d2aa86e4a7e962a3ab77f7a8273": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_ff38e290d9a64c278516e145deecc897",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_e49f4db542124aca8f76cf4b06349c82"
          }
        },
        "eacc536b63f2400a9c4f6be177091392": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_b868fb0c55334e0ebe80ba6aee0dcef4",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "info",
            "max": 1,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 1,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_b4b03eda171b46c6a650072ca9b9a531"
          }
        },
        "9ca3ad6866da44dba367f66d270833d0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_d213620bb39d418c8192e0b4f1aa1527",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 49870/0 [00:16&lt;00:00, 3292.67 examples/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_99c080ff83dd44c2a7417d95cc7c6ec6"
          }
        },
        "ff38e290d9a64c278516e145deecc897": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "e49f4db542124aca8f76cf4b06349c82": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "b868fb0c55334e0ebe80ba6aee0dcef4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "b4b03eda171b46c6a650072ca9b9a531": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": "20px",
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "d213620bb39d418c8192e0b4f1aa1527": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "99c080ff83dd44c2a7417d95cc7c6ec6": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "5e4939b0cab54ef99b0e6bb40a13dde3": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_61ee760e4e8a430880bd5a3e37c6bff0",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_348ae2e7b3664343bd53338378b9ae2c",
              "IPY_MODEL_731cd9cafdfa43928b0889ff20ced2b5",
              "IPY_MODEL_00cd9acab836432bbdce7006b9b4eee7"
            ]
          }
        },
        "61ee760e4e8a430880bd5a3e37c6bff0": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "348ae2e7b3664343bd53338378b9ae2c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_6992bacad45549379fc91f5e2cca8218",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_7d4bbf96638e45d496e63cdee1e7af44"
          }
        },
        "731cd9cafdfa43928b0889ff20ced2b5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_6f88279316154c98b7352b6e784e5453",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "info",
            "max": 1,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 1,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_81f57f6e8b4d4f3aaf0b250ad62e9fd5"
          }
        },
        "00cd9acab836432bbdce7006b9b4eee7": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_fb4ce2b03ea3432eb973fca353da732a",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 9823/0 [00:03&lt;00:00, 3381.22 examples/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_5b5aef133a8744c5b20b0db5622bc72f"
          }
        },
        "6992bacad45549379fc91f5e2cca8218": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "7d4bbf96638e45d496e63cdee1e7af44": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "6f88279316154c98b7352b6e784e5453": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "81f57f6e8b4d4f3aaf0b250ad62e9fd5": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": "20px",
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "fb4ce2b03ea3432eb973fca353da732a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "5b5aef133a8744c5b20b0db5622bc72f": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "3eeedb12a1f0479da9831bb4bd65966c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_8565bae35db7410488290de3ea0ca060",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_4b1e931b591345f1b00a19c67358e307",
              "IPY_MODEL_921014d2079f4b40b6c451765eca4dd3",
              "IPY_MODEL_6a30d530a6614210b1172582e391e8d1"
            ]
          }
        },
        "8565bae35db7410488290de3ea0ca060": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "4b1e931b591345f1b00a19c67358e307": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_1e25d37c080a4113951e7c00ef3f1f9f",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "100%",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_13602ceee6844843abdf9198ec7d9551"
          }
        },
        "921014d2079f4b40b6c451765eca4dd3": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_c0f355c2943e44ebbf0374417239ea27",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 2,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 2,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_37897396a01a4b478a0e9d1520f1b454"
          }
        },
        "6a30d530a6614210b1172582e391e8d1": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_e678ecadc0e54506bf5279c3adc88896",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 2/2 [00:00&lt;00:00, 46.28it/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_1f01007386c84d99978997e1035ea00d"
          }
        },
        "1e25d37c080a4113951e7c00ef3f1f9f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "13602ceee6844843abdf9198ec7d9551": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "c0f355c2943e44ebbf0374417239ea27": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "37897396a01a4b478a0e9d1520f1b454": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "e678ecadc0e54506bf5279c3adc88896": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "1f01007386c84d99978997e1035ea00d": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "be39fc38efe34785b1028723a7237204": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_b1b4b0e053ce4ddf92567061541c0aa4",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_c880327800cc4f01ba7fd2b2456b26d1",
              "IPY_MODEL_1241e8ea8eb54c9fb07cdb362c1b89fb",
              "IPY_MODEL_73156e4833a1499491aa9d59dc3a5288"
            ]
          }
        },
        "b1b4b0e053ce4ddf92567061541c0aa4": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "c880327800cc4f01ba7fd2b2456b26d1": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_5b7227f425fa4462a8f5c945ed5e1bb9",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "Downloading: 100%",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_285eb3f190d440f887458836cf84c054"
          }
        },
        "1241e8ea8eb54c9fb07cdb362c1b89fb": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_96507032fb37454a819ad3c950957a6d",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 70082,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 70082,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_16e6ebb819ac4183af18589e069cf36d"
          }
        },
        "73156e4833a1499491aa9d59dc3a5288": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_886453f5c48b49d685f1cd2c6724f79c",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 68.4k/68.4k [00:00&lt;00:00, 200kB/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_f56c3bc9fa7a4bb9933c825e14d698fe"
          }
        },
        "5b7227f425fa4462a8f5c945ed5e1bb9": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "285eb3f190d440f887458836cf84c054": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "96507032fb37454a819ad3c950957a6d": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "16e6ebb819ac4183af18589e069cf36d": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "886453f5c48b49d685f1cd2c6724f79c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "f56c3bc9fa7a4bb9933c825e14d698fe": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "36d5f71a40724eb0981640b0d5821dbe": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_9a1edde2a5664ae39646df034a2d6064",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_bf8e8fcd8bb145e79ecb7f20969f336a",
              "IPY_MODEL_56b3b3302b5f44d8b5f5b4f6f91a6219",
              "IPY_MODEL_d85d833e322b4f68919af303387d0ac8"
            ]
          }
        },
        "9a1edde2a5664ae39646df034a2d6064": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "bf8e8fcd8bb145e79ecb7f20969f336a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_da2ff33d3a4d4365af4c786f1890d3bb",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "Downloading: 100%",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_95144b323fef4c0bab77e7b0953909f1"
          }
        },
        "56b3b3302b5f44d8b5f5b4f6f91a6219": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_167e85e6a88b4960ad14f5592b24363e",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 249079335,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 249079335,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_e0dc0e5cb13d4019a45a148137a69d0a"
          }
        },
        "d85d833e322b4f68919af303387d0ac8": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_0394c7ee27bc47a986d322af45b7ea9f",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 238M/238M [00:06&lt;00:00, 45.4MB/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_05ea061066a4479aa26691a05d14408b"
          }
        },
        "da2ff33d3a4d4365af4c786f1890d3bb": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "95144b323fef4c0bab77e7b0953909f1": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "167e85e6a88b4960ad14f5592b24363e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "e0dc0e5cb13d4019a45a148137a69d0a": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "0394c7ee27bc47a986d322af45b7ea9f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "05ea061066a4479aa26691a05d14408b": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "431ce04341104413a241878d0a1bef85": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_f21baad907a8402c819f0464b3e3a247",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_c311ef2d3c1a4c43b76f9a0fbed71dcc",
              "IPY_MODEL_bb830a6f272f40589a4b9539e3b5bf58",
              "IPY_MODEL_fe9ae02806544e5497578368139c6375"
            ]
          }
        },
        "f21baad907a8402c819f0464b3e3a247": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "c311ef2d3c1a4c43b76f9a0fbed71dcc": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_9cfaa9c8d2804fc2826e07d18e1e4af5",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "100%",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_a04f9527f29e4733b6e577fb1b20eb0a"
          }
        },
        "bb830a6f272f40589a4b9539e3b5bf58": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_f2ad9419e97c436c82504c52e175e65f",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 225,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 225,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_1765ce2d985a445da061f8634c1c2a6d"
          }
        },
        "fe9ae02806544e5497578368139c6375": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_c07e9b2c463b45eb936257395d8376cd",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 225/225 [02:18&lt;00:00,  1.63it/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_e6982bddf0ec4151a7859ac54ed5bef0"
          }
        },
        "9cfaa9c8d2804fc2826e07d18e1e4af5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "a04f9527f29e4733b6e577fb1b20eb0a": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "f2ad9419e97c436c82504c52e175e65f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "1765ce2d985a445da061f8634c1c2a6d": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "c07e9b2c463b45eb936257395d8376cd": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "e6982bddf0ec4151a7859ac54ed5bef0": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "14f88ca20c50418b9bab7f4f439543a6": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_04e9e01d43394aa8b5a7de930b804f70",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_1335bfe672844219919dc613c76edc33",
              "IPY_MODEL_17e3436f0d8843b8bea313f923662f95",
              "IPY_MODEL_b179631432ad406d8ac3241837d494c2"
            ]
          }
        },
        "04e9e01d43394aa8b5a7de930b804f70": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "1335bfe672844219919dc613c76edc33": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_6fa7b93516374065806d3b7ca79df994",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "100%",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_9abf2e943dcf4fa08642ebfe123498f4"
          }
        },
        "17e3436f0d8843b8bea313f923662f95": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_376ebdb254cd4d5fa3e49c4bc24d61c6",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 225,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 225,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_fed17776c9ea4d3684423fee9db060a6"
          }
        },
        "b179631432ad406d8ac3241837d494c2": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_848d973f0822402dafd0332185948f52",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 225/225 [02:18&lt;00:00,  1.63it/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_6c432c844ea9491eace4894bd8cb7a26"
          }
        },
        "6fa7b93516374065806d3b7ca79df994": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "9abf2e943dcf4fa08642ebfe123498f4": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "376ebdb254cd4d5fa3e49c4bc24d61c6": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "fed17776c9ea4d3684423fee9db060a6": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "848d973f0822402dafd0332185948f52": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "6c432c844ea9491eace4894bd8cb7a26": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "95921ef023eb4398b5d07dd3541f50c0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HBoxView",
            "_dom_classes": [],
            "_model_name": "HBoxModel",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "box_style": "",
            "layout": "IPY_MODEL_690fc0996ddf447d8e455ff487a3f29d",
            "_model_module": "@jupyter-widgets/controls",
            "children": [
              "IPY_MODEL_4f6430e6948b4886a870926ac0543700",
              "IPY_MODEL_f55f397abefa4bf88ead5de3cb3ae388",
              "IPY_MODEL_501067db0a784e4eaac966717c618b84"
            ]
          }
        },
        "690fc0996ddf447d8e455ff487a3f29d": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "4f6430e6948b4886a870926ac0543700": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_ad8744b246914633bb88cd2688d07bc5",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": "100%",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_0c049e8291834040808c840a8977d772"
          }
        },
        "f55f397abefa4bf88ead5de3cb3ae388": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "ProgressView",
            "style": "IPY_MODEL_ce7f9575525443ce97fb133be2805b5c",
            "_dom_classes": [],
            "description": "",
            "_model_name": "FloatProgressModel",
            "bar_style": "success",
            "max": 25,
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": 25,
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "orientation": "horizontal",
            "min": 0,
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_7b227fb0b8c24802a86349047f9d52ed"
          }
        },
        "501067db0a784e4eaac966717c618b84": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "HTMLView",
            "style": "IPY_MODEL_dffd00dbe9294289834632c502ae5e2c",
            "_dom_classes": [],
            "description": "",
            "_model_name": "HTMLModel",
            "placeholder": "​",
            "_view_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "value": " 25/25 [00:05&lt;00:00,  4.60it/s]",
            "_view_count": null,
            "_view_module_version": "1.5.0",
            "description_tooltip": null,
            "_model_module": "@jupyter-widgets/controls",
            "layout": "IPY_MODEL_d46a9599c9f84adc9595312f150b3c85"
          }
        },
        "ad8744b246914633bb88cd2688d07bc5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "0c049e8291834040808c840a8977d772": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "ce7f9575525443ce97fb133be2805b5c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "ProgressStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "bar_color": null,
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "7b227fb0b8c24802a86349047f9d52ed": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        },
        "dffd00dbe9294289834632c502ae5e2c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_view_name": "StyleView",
            "_model_name": "DescriptionStyleModel",
            "description_width": "",
            "_view_module": "@jupyter-widgets/base",
            "_model_module_version": "1.5.0",
            "_view_count": null,
            "_view_module_version": "1.2.0",
            "_model_module": "@jupyter-widgets/controls"
          }
        },
        "d46a9599c9f84adc9595312f150b3c85": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_view_name": "LayoutView",
            "grid_template_rows": null,
            "right": null,
            "justify_content": null,
            "_view_module": "@jupyter-widgets/base",
            "overflow": null,
            "_model_module_version": "1.2.0",
            "_view_count": null,
            "flex_flow": null,
            "width": null,
            "min_width": null,
            "border": null,
            "align_items": null,
            "bottom": null,
            "_model_module": "@jupyter-widgets/base",
            "top": null,
            "grid_column": null,
            "overflow_y": null,
            "overflow_x": null,
            "grid_auto_flow": null,
            "grid_area": null,
            "grid_template_columns": null,
            "flex": null,
            "_model_name": "LayoutModel",
            "justify_items": null,
            "grid_row": null,
            "max_height": null,
            "align_content": null,
            "visibility": null,
            "align_self": null,
            "height": null,
            "min_height": null,
            "padding": null,
            "grid_auto_rows": null,
            "grid_gap": null,
            "max_width": null,
            "order": null,
            "_view_module_version": "1.2.0",
            "grid_template_areas": null,
            "object_position": null,
            "object_fit": null,
            "grid_auto_columns": null,
            "margin": null,
            "display": null,
            "left": null
          }
        }
      }
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/Perceiver/Fine_tune_the_Perceiver_for_image_classification.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "XdLXhIQ5nTwI"
      },
      "source": [
        "In this notebook, we are going to show how to fine-tune the Perceiver for image classification.\n",
        "\n",
        "For more info regarding the Perceiver, I refer to:\n",
        "\n",
        "* the Transformers docs: https://huggingface.co/docs/transformers/model_doc/perceiver\n",
        "* the blog post: https://huggingface.co/blog/perceiver\n",
        "\n",
        "## Set-up environment\n",
        "\n",
        "We first install HuggingFace Transformers & Datasets."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "aUqdwqGmnKGh",
        "outputId": "31617645-73b4-42e5-a98c-30c10742916e"
      },
      "source": [
        "!pip install -q transformers datasets"
      ],
      "execution_count": 1,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "\u001b[K     |████████████████████████████████| 3.4 MB 6.4 MB/s \n",
            "\u001b[K     |████████████████████████████████| 306 kB 52.0 MB/s \n",
            "\u001b[K     |████████████████████████████████| 596 kB 39.2 MB/s \n",
            "\u001b[K     |████████████████████████████████| 895 kB 55.4 MB/s \n",
            "\u001b[K     |████████████████████████████████| 61 kB 331 kB/s \n",
            "\u001b[K     |████████████████████████████████| 3.3 MB 51.8 MB/s \n",
            "\u001b[K     |████████████████████████████████| 1.1 MB 49.6 MB/s \n",
            "\u001b[K     |████████████████████████████████| 132 kB 50.4 MB/s \n",
            "\u001b[K     |████████████████████████████████| 243 kB 65.3 MB/s \n",
            "\u001b[K     |████████████████████████████████| 192 kB 70.7 MB/s \n",
            "\u001b[K     |████████████████████████████████| 271 kB 68.7 MB/s \n",
            "\u001b[K     |████████████████████████████████| 160 kB 72.1 MB/s \n",
            "\u001b[?25h"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "rOo5kKk8nVms"
      },
      "source": [
        "## Load data\n",
        "\n",
        "Here we load a small portion of the CIFAR-10 dataset, for demonstration purposes."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 200,
          "referenced_widgets": [
            "770a106a490f4725a21eedc8f7e45405",
            "e785dba574de44b5bfb592dbb579d6ff",
            "e58da15de3ec444581b19a238581482b",
            "c3356fc067854f80b6c348321cd40903",
            "25b6ebb9dd134d468a12ab68397e403c",
            "b97132e5502f4a57848e50450a0a4beb",
            "9cb91cbce0154dce98e7fa6b75abb8de",
            "1b87dae262ed418b89b24cbd467966ff",
            "bba8ba7e0bcf485287d6ef0388bc57a6",
            "aadeaaedbd784ba58ca32891812e3508",
            "24d991b2c27f43e9a2150be8eafc8640",
            "b958aa8c5d814d6b8c46939692ece060",
            "5212006a87084ee1a19027cc0ce685f3",
            "59016efe4b954651925dd091cf2665f6",
            "68346f8cf24b4369be76241cd83d3acf",
            "6a9eff7147ea4b058c97bfd5e5d4a595",
            "d4717be36e3a4637afb2846f34b7774b",
            "77b214275fb94023bb553a73f67a98d0",
            "7030c8c403a94c66a35d0e97a796a772",
            "51e775c014b84048919b4ab67e735f7b",
            "ef54be240c00421582752d225a0954ea",
            "790f2199d4424bc0867458d51a82b658",
            "7e104651b85743a29f9950bbfeaa625a",
            "3ab85dba0ded4c17848bd92fc4020622",
            "4fd75dae213f4111a1e6ff0f4691d9e5",
            "5791f085865f456aa48fb955c39b263f",
            "f11ace7da9f84397874ba76d6240e7e5",
            "b8576770cf6f4525aec2a48eb32fd2f9",
            "0e8cfb4155cf4f43a24f5d3f1b2e68fd",
            "feba1fc9283649c998dd99387c255119",
            "5b7da64698264b9987d0fd02c5114977",
            "439d664b873240b98e2850ce20102d0f",
            "ed947e965a584eb79ad05a77579a19f5",
            "7feab8f71b864c07be8d5852cdec0951",
            "e321fa1ddeea4522a17c2dc812cbbb8a",
            "7c572d2aa86e4a7e962a3ab77f7a8273",
            "eacc536b63f2400a9c4f6be177091392",
            "9ca3ad6866da44dba367f66d270833d0",
            "ff38e290d9a64c278516e145deecc897",
            "e49f4db542124aca8f76cf4b06349c82",
            "b868fb0c55334e0ebe80ba6aee0dcef4",
            "b4b03eda171b46c6a650072ca9b9a531",
            "d213620bb39d418c8192e0b4f1aa1527",
            "99c080ff83dd44c2a7417d95cc7c6ec6",
            "5e4939b0cab54ef99b0e6bb40a13dde3",
            "61ee760e4e8a430880bd5a3e37c6bff0",
            "348ae2e7b3664343bd53338378b9ae2c",
            "731cd9cafdfa43928b0889ff20ced2b5",
            "00cd9acab836432bbdce7006b9b4eee7",
            "6992bacad45549379fc91f5e2cca8218",
            "7d4bbf96638e45d496e63cdee1e7af44",
            "6f88279316154c98b7352b6e784e5453",
            "81f57f6e8b4d4f3aaf0b250ad62e9fd5",
            "fb4ce2b03ea3432eb973fca353da732a",
            "5b5aef133a8744c5b20b0db5622bc72f",
            "3eeedb12a1f0479da9831bb4bd65966c",
            "8565bae35db7410488290de3ea0ca060",
            "4b1e931b591345f1b00a19c67358e307",
            "921014d2079f4b40b6c451765eca4dd3",
            "6a30d530a6614210b1172582e391e8d1",
            "1e25d37c080a4113951e7c00ef3f1f9f",
            "13602ceee6844843abdf9198ec7d9551",
            "c0f355c2943e44ebbf0374417239ea27",
            "37897396a01a4b478a0e9d1520f1b454",
            "e678ecadc0e54506bf5279c3adc88896",
            "1f01007386c84d99978997e1035ea00d"
          ]
        },
        "id": "-EkHaXm-nTRP",
        "outputId": "e534e765-9a39-48a4-82e9-b1efe64cab52"
      },
      "source": [
        "from datasets import load_dataset\n",
        "\n",
        "# load cifar10 (only small portion for demonstration purposes) \n",
        "train_ds, test_ds = load_dataset('cifar10', split=['train[:500]', 'test[:200]'])\n",
        "# split up training into training + validation\n",
        "splits = train_ds.train_test_split(test_size=0.1)\n",
        "train_ds = splits['train']\n",
        "val_ds = splits['test']"
      ],
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "770a106a490f4725a21eedc8f7e45405",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "Downloading:   0%|          | 0.00/1.55k [00:00<?, ?B/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "b958aa8c5d814d6b8c46939692ece060",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "Downloading:   0%|          | 0.00/799 [00:00<?, ?B/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Downloading and preparing dataset cifar10/plain_text (download: 162.60 MiB, generated: 130.30 MiB, post-processed: Unknown size, total: 292.90 MiB) to /root/.cache/huggingface/datasets/cifar10/plain_text/1.0.0/7cc98527296ba6b416e709858ac23013f8e6b0201b1d8bb088fb4071379806ca...\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "7e104651b85743a29f9950bbfeaa625a",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "Downloading:   0%|          | 0.00/170M [00:00<?, ?B/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "7feab8f71b864c07be8d5852cdec0951",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "0 examples [00:00, ? examples/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "5e4939b0cab54ef99b0e6bb40a13dde3",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "0 examples [00:00, ? examples/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Dataset cifar10 downloaded and prepared to /root/.cache/huggingface/datasets/cifar10/plain_text/1.0.0/7cc98527296ba6b416e709858ac23013f8e6b0201b1d8bb088fb4071379806ca. Subsequent calls will reuse this data.\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "3eeedb12a1f0479da9831bb4bd65966c",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "  0%|          | 0/2 [00:00<?, ?it/s]"
            ]
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "We'll define the id2label and label2id dictionaries, as these will be useful when doing inference."
      ],
      "metadata": {
        "id": "niKEHKc8D_My"
      }
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "h_05E_KY0XuK",
        "outputId": "8f5eeecc-76bb-48f5-ffc8-eb267f2d499e"
      },
      "source": [
        "id2label = {idx:label for idx,label in enumerate(train_ds.features['label'].names)}\n",
        "label2id = {label:idx for idx, label in id2label.items()}\n",
        "print(id2label)\n",
        "print(label2id)"
      ],
      "execution_count": 3,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "{0: 'airplane', 1: 'automobile', 2: 'bird', 3: 'cat', 4: 'deer', 5: 'dog', 6: 'frog', 7: 'horse', 8: 'ship', 9: 'truck'}\n",
            "{'airplane': 0, 'automobile': 1, 'bird': 2, 'cat': 3, 'deer': 4, 'dog': 5, 'frog': 6, 'horse': 7, 'ship': 8, 'truck': 9}\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "We can prepare the data for the model using the feature extractor.\n",
        "\n",
        "Note that this feature extractor is fairly basic: it will just do center cropping + resizing + normalizing of the color channels.\n",
        "\n",
        "One should actually add several data augmentations (available in libraries like [torchvision](https://pytorch.org/vision/stable/transforms.html) and [albumentations](https://albumentations.ai/) to achieve greater results. I refer to my [ViT notebook](https://github.com/NielsRogge/Transformers-Tutorials/blob/master/VisionTransformer/Fine_tuning_the_Vision_Transformer_on_CIFAR_10_with_the_%F0%9F%A4%97_Trainer.ipynb) for an example."
      ],
      "metadata": {
        "id": "gNc87-A3EGRH"
      }
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Zqm97jhenqcL"
      },
      "source": [
        "from transformers import PerceiverFeatureExtractor\n",
        "\n",
        "feature_extractor = PerceiverFeatureExtractor()"
      ],
      "execution_count": 4,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "source": [
        "Note that HuggingFace Datasets has an Image feature, meaning that every image is a PIL (Pillow) image by default. The feature extractor will turn each Pillow image into a PyTorch tensor of shape (3, 224, 224).\n",
        "\n",
        "Note that Apache Arrow (which HuggingFace Datasets uses as a back-end) doesn't know PyTorch Tensors, but we can escape it by using the `set_transform` method on the Dataset, which allows to only prepare images when we need them (i.e. on-the-fly). This is awesome as it saves memory! Refer to the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.set_transform) for more information."
      ],
      "metadata": {
        "id": "7tHGPQAC6rLw"
      }
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "B6euyHHanlJd"
      },
      "source": [
        "import numpy as np\n",
        "\n",
        "def preprocess_images(examples):\n",
        "    examples['pixel_values'] = feature_extractor(examples['img'], return_tensors=\"pt\").pixel_values\n",
        "    return examples"
      ],
      "execution_count": 10,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "# Set the transforms\n",
        "train_ds.set_transform(preprocess_images)\n",
        "val_ds.set_transform(preprocess_images)\n",
        "test_ds.set_transform(preprocess_images)"
      ],
      "metadata": {
        "id": "ZzI3qxf6NHkm"
      },
      "execution_count": 11,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "source": [
        "We can now load preprocessed images (on-the-fly) as follows:"
      ],
      "metadata": {
        "id": "7iENyxYMzl4a"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "train_ds[:2]"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "NOqUVXdPkDET",
        "outputId": "49fab394-ca35-4d9c-e6ee-10a20bcc8bfa"
      },
      "execution_count": 12,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "{'img': [<PIL.PngImagePlugin.PngImageFile image mode=RGB size=32x32 at 0x7FDC654E27D0>,\n",
              "  <PIL.PngImagePlugin.PngImageFile image mode=RGB size=32x32 at 0x7FDC654E2110>],\n",
              " 'label': [7, 5],\n",
              " 'pixel_values': tensor([[[[-0.1828, -0.1828, -0.1999,  ..., -0.5253, -0.5253, -0.5253],\n",
              "           [-0.1828, -0.1828, -0.1999,  ..., -0.5253, -0.5253, -0.5253],\n",
              "           [-0.1999, -0.1999, -0.2171,  ..., -0.5253, -0.5253, -0.5253],\n",
              "           ...,\n",
              "           [ 0.5022,  0.5022,  0.5022,  ...,  0.0912,  0.0741,  0.0741],\n",
              "           [ 0.5022,  0.5022,  0.5022,  ...,  0.1254,  0.1083,  0.1083],\n",
              "           [ 0.5022,  0.5022,  0.5022,  ...,  0.1426,  0.1254,  0.1254]],\n",
              " \n",
              "          [[-0.1800, -0.1800, -0.2150,  ..., -0.6176, -0.6176, -0.6176],\n",
              "           [-0.1975, -0.1975, -0.2150,  ..., -0.6176, -0.6176, -0.6176],\n",
              "           [-0.1975, -0.1975, -0.2150,  ..., -0.6176, -0.6176, -0.6176],\n",
              "           ...,\n",
              "           [ 0.5903,  0.5903,  0.5903,  ...,  0.2227,  0.2227,  0.2227],\n",
              "           [ 0.5903,  0.5903,  0.5903,  ...,  0.2577,  0.2577,  0.2577],\n",
              "           [ 0.5903,  0.5903,  0.5903,  ...,  0.2752,  0.2752,  0.2752]],\n",
              " \n",
              "          [[-0.2881, -0.3055, -0.3055,  ..., -0.7413, -0.7238, -0.7238],\n",
              "           [-0.2881, -0.3055, -0.3055,  ..., -0.7413, -0.7238, -0.7238],\n",
              "           [-0.2881, -0.3055, -0.3055,  ..., -0.7413, -0.7238, -0.7238],\n",
              "           ...,\n",
              "           [ 0.6705,  0.6705,  0.6705,  ...,  0.2871,  0.2871,  0.2871],\n",
              "           [ 0.6705,  0.6705,  0.6705,  ...,  0.3045,  0.3045,  0.3045],\n",
              "           [ 0.6705,  0.6705,  0.6705,  ...,  0.3219,  0.3219,  0.3219]]],\n",
              " \n",
              " \n",
              "         [[[-2.1179, -2.1179, -2.1179,  ..., -2.1179, -2.1179, -2.1179],\n",
              "           [-2.1179, -2.1179, -2.1179,  ..., -2.1179, -2.1179, -2.1179],\n",
              "           [-2.1179, -2.1179, -2.1179,  ..., -2.1179, -2.1179, -2.1179],\n",
              "           ...,\n",
              "           [-2.1008, -2.1008, -2.1008,  ...,  1.3927,  1.3927,  1.3927],\n",
              "           [-2.1008, -2.1008, -2.1008,  ...,  1.4098,  1.4098,  1.4098],\n",
              "           [-2.1008, -2.1008, -2.1008,  ...,  1.4098,  1.4098,  1.4098]],\n",
              " \n",
              "          [[-2.0357, -2.0357, -2.0357,  ..., -1.9832, -1.9832, -1.9832],\n",
              "           [-2.0357, -2.0357, -2.0357,  ..., -1.9832, -1.9832, -1.9832],\n",
              "           [-2.0357, -2.0357, -2.0357,  ..., -1.9832, -1.9832, -1.9832],\n",
              "           ...,\n",
              "           [-2.0182, -2.0182, -2.0182,  ...,  0.8529,  0.8529,  0.8529],\n",
              "           [-2.0182, -2.0182, -2.0182,  ...,  0.8704,  0.8704,  0.8704],\n",
              "           [-2.0182, -2.0182, -2.0182,  ...,  0.8880,  0.8880,  0.8880]],\n",
              " \n",
              "          [[-1.7696, -1.7696, -1.7696,  ..., -0.5321, -0.5321, -0.5321],\n",
              "           [-1.7696, -1.7696, -1.7696,  ..., -0.5321, -0.5321, -0.5321],\n",
              "           [-1.7696, -1.7696, -1.7696,  ..., -0.5147, -0.5147, -0.5147],\n",
              "           ...,\n",
              "           [-0.6541, -0.6541, -0.6541,  ...,  0.5485,  0.5659,  0.5659],\n",
              "           [-0.6541, -0.6541, -0.6541,  ...,  0.5485,  0.5659,  0.5659],\n",
              "           [-0.6715, -0.6715, -0.6715,  ...,  0.5659,  0.5834,  0.5834]]]])}"
            ]
          },
          "metadata": {},
          "execution_count": 12
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "It's very easy to create corresponding PyTorch DataLoaders, like so:"
      ],
      "metadata": {
        "id": "gNnLHRNbzsWU"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from torch.utils.data import DataLoader\n",
        "import torch\n",
        "\n",
        "def collate_fn(examples):\n",
        "    pixel_values = torch.stack([example[\"pixel_values\"] for example in examples])\n",
        "    labels = torch.tensor([example[\"label\"] for example in examples])\n",
        "    return {\"pixel_values\": pixel_values, \"labels\": labels}\n",
        "\n",
        "train_batch_size = 2\n",
        "eval_batch_size = 2\n",
        "\n",
        "train_dataloader = DataLoader(train_ds, shuffle=True, collate_fn=collate_fn, batch_size=train_batch_size)\n",
        "val_dataloader = DataLoader(val_ds, collate_fn=collate_fn, batch_size=eval_batch_size)\n",
        "test_dataloader = DataLoader(test_ds, collate_fn=collate_fn, batch_size=eval_batch_size)"
      ],
      "metadata": {
        "id": "hMOC0oBnhjRM"
      },
      "execution_count": 17,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "source": [
        "We can verify our data a bit:"
      ],
      "metadata": {
        "id": "1I4Ja_7lEjq6"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "batch = next(iter(train_dataloader))\n",
        "for k,v in batch.items():\n",
        "  if isinstance(v, torch.Tensor):\n",
        "    print(k, v.shape)"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "fZpqx7giniv8",
        "outputId": "3c721c8e-66fc-4ed3-a382-35bcad58d9a1"
      },
      "execution_count": 18,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "pixel_values torch.Size([2, 3, 224, 224])\n",
            "labels torch.Size([2])\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Some more verification:"
      ],
      "metadata": {
        "id": "rn2vGjwNEniu"
      }
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "rMjAFsEEzlQW"
      },
      "source": [
        "assert batch['pixel_values'].shape == (train_batch_size, 3, 224, 224)\n",
        "assert batch['labels'].shape == (train_batch_size,)"
      ],
      "execution_count": 20,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "npMiFNnRznc0",
        "outputId": "e39c3b29-dac1-48b8-878e-83bf86687e21"
      },
      "source": [
        "next(iter(val_dataloader))['pixel_values'].shape"
      ],
      "execution_count": 21,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "torch.Size([2, 3, 224, 224])"
            ]
          },
          "metadata": {},
          "execution_count": 21
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Gy_v8RFYzdqB"
      },
      "source": [
        "## Define model\n",
        "\n",
        "Here we only replace the final projection layer of the decoder (`PerceiverClassificationDecoder`) of the checkpoint that was trained on ImageNet. This means that we will use the same (learned) output queries as before, hence the cross-attention operation will give the same output. However, the final projection layer has 1000 output neurons during pre-training, while we only have 10.\n",
        "\n",
        "NOTE: note that the Perceiver has 3 variants for image classification:\n",
        "* PerceiverForImageClassificationLearned\n",
        "* PerceiverForImageClassificationFourier\n",
        "* PerceiverForImageClassificationConvProcessing.\n",
        "\n",
        "Here I'm using the first one, which adds learned 1D position embeddings to the pixel values. Note that the best results will be obtained with the latter.\n",
        "\n",
        "For in-depth understanding on how the Perceiver works, I refer to my [blog post](https://huggingface.co/blog/perceiver).\n",
        "\n",
        "We can use the handy `ignore_mismatched_sizes` to replace the head. We also set the `id2label` and `label2id` mappings we defined earlier (which will be handy when doing inference)."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000,
          "referenced_widgets": [
            "be39fc38efe34785b1028723a7237204",
            "b1b4b0e053ce4ddf92567061541c0aa4",
            "c880327800cc4f01ba7fd2b2456b26d1",
            "1241e8ea8eb54c9fb07cdb362c1b89fb",
            "73156e4833a1499491aa9d59dc3a5288",
            "5b7227f425fa4462a8f5c945ed5e1bb9",
            "285eb3f190d440f887458836cf84c054",
            "96507032fb37454a819ad3c950957a6d",
            "16e6ebb819ac4183af18589e069cf36d",
            "886453f5c48b49d685f1cd2c6724f79c",
            "f56c3bc9fa7a4bb9933c825e14d698fe",
            "36d5f71a40724eb0981640b0d5821dbe",
            "9a1edde2a5664ae39646df034a2d6064",
            "bf8e8fcd8bb145e79ecb7f20969f336a",
            "56b3b3302b5f44d8b5f5b4f6f91a6219",
            "d85d833e322b4f68919af303387d0ac8",
            "da2ff33d3a4d4365af4c786f1890d3bb",
            "95144b323fef4c0bab77e7b0953909f1",
            "167e85e6a88b4960ad14f5592b24363e",
            "e0dc0e5cb13d4019a45a148137a69d0a",
            "0394c7ee27bc47a986d322af45b7ea9f",
            "05ea061066a4479aa26691a05d14408b"
          ]
        },
        "id": "VBIGSyxizpNu",
        "outputId": "0ad9a248-a54f-4aa5-bb57-054609150291"
      },
      "source": [
        "from transformers import PerceiverForImageClassificationLearned \n",
        "\n",
        "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
        "\n",
        "model = PerceiverForImageClassificationLearned.from_pretrained(\"deepmind/vision-perceiver-learned\",\n",
        "                                                               num_labels=10,\n",
        "                                                               id2label=id2label,\n",
        "                                                               label2id=label2id,\n",
        "                                                               ignore_mismatched_sizes=True)\n",
        "model.to(device)"
      ],
      "execution_count": 22,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "be39fc38efe34785b1028723a7237204",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "Downloading:   0%|          | 0.00/68.4k [00:00<?, ?B/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "36d5f71a40724eb0981640b0d5821dbe",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "Downloading:   0%|          | 0.00/238M [00:00<?, ?B/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "Some weights of PerceiverForImageClassificationLearned were not initialized from the model checkpoint at deepmind/vision-perceiver-learned and are newly initialized because the shapes did not match:\n",
            "- perceiver.decoder.decoder.final_layer.weight: found shape torch.Size([1000, 1024]) in the checkpoint and torch.Size([10, 1024]) in the model instantiated\n",
            "- perceiver.decoder.decoder.final_layer.bias: found shape torch.Size([1000]) in the checkpoint and torch.Size([10]) in the model instantiated\n",
            "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"
          ]
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "PerceiverForImageClassificationLearned(\n",
              "  (perceiver): PerceiverModel(\n",
              "    (input_preprocessor): PerceiverImagePreprocessor(\n",
              "      (convnet_1x1): Conv2d(3, 256, kernel_size=(1, 1), stride=(1, 1))\n",
              "      (position_embeddings): PerceiverTrainablePositionEncoding()\n",
              "      (positions_projection): Linear(in_features=256, out_features=256, bias=True)\n",
              "      (conv_after_patches): Identity()\n",
              "    )\n",
              "    (embeddings): PerceiverEmbeddings()\n",
              "    (encoder): PerceiverEncoder(\n",
              "      (cross_attention): PerceiverLayer(\n",
              "        (attention): PerceiverAttention(\n",
              "          (self): PerceiverSelfAttention(\n",
              "            (layernorm1): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "            (layernorm2): LayerNorm((512,), eps=1e-05, elementwise_affine=True)\n",
              "            (query): Linear(in_features=1024, out_features=512, bias=True)\n",
              "            (key): Linear(in_features=512, out_features=512, bias=True)\n",
              "            (value): Linear(in_features=512, out_features=512, bias=True)\n",
              "            (dropout): Dropout(p=0.1, inplace=False)\n",
              "          )\n",
              "          (output): PerceiverSelfOutput(\n",
              "            (dense): Linear(in_features=512, out_features=1024, bias=True)\n",
              "          )\n",
              "        )\n",
              "        (layernorm): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "        (mlp): PerceiverMLP(\n",
              "          (dense1): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "          (dense2): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "        )\n",
              "      )\n",
              "      (self_attends): ModuleList(\n",
              "        (0): PerceiverLayer(\n",
              "          (attention): PerceiverAttention(\n",
              "            (self): PerceiverSelfAttention(\n",
              "              (layernorm1): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "              (layernorm2): Identity()\n",
              "              (query): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (key): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (value): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (dropout): Dropout(p=0.1, inplace=False)\n",
              "            )\n",
              "            (output): PerceiverSelfOutput(\n",
              "              (dense): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            )\n",
              "          )\n",
              "          (layernorm): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "          (mlp): PerceiverMLP(\n",
              "            (dense1): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            (dense2): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "          )\n",
              "        )\n",
              "        (1): PerceiverLayer(\n",
              "          (attention): PerceiverAttention(\n",
              "            (self): PerceiverSelfAttention(\n",
              "              (layernorm1): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "              (layernorm2): Identity()\n",
              "              (query): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (key): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (value): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (dropout): Dropout(p=0.1, inplace=False)\n",
              "            )\n",
              "            (output): PerceiverSelfOutput(\n",
              "              (dense): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            )\n",
              "          )\n",
              "          (layernorm): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "          (mlp): PerceiverMLP(\n",
              "            (dense1): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            (dense2): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "          )\n",
              "        )\n",
              "        (2): PerceiverLayer(\n",
              "          (attention): PerceiverAttention(\n",
              "            (self): PerceiverSelfAttention(\n",
              "              (layernorm1): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "              (layernorm2): Identity()\n",
              "              (query): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (key): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (value): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (dropout): Dropout(p=0.1, inplace=False)\n",
              "            )\n",
              "            (output): PerceiverSelfOutput(\n",
              "              (dense): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            )\n",
              "          )\n",
              "          (layernorm): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "          (mlp): PerceiverMLP(\n",
              "            (dense1): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            (dense2): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "          )\n",
              "        )\n",
              "        (3): PerceiverLayer(\n",
              "          (attention): PerceiverAttention(\n",
              "            (self): PerceiverSelfAttention(\n",
              "              (layernorm1): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "              (layernorm2): Identity()\n",
              "              (query): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (key): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (value): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (dropout): Dropout(p=0.1, inplace=False)\n",
              "            )\n",
              "            (output): PerceiverSelfOutput(\n",
              "              (dense): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            )\n",
              "          )\n",
              "          (layernorm): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "          (mlp): PerceiverMLP(\n",
              "            (dense1): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            (dense2): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "          )\n",
              "        )\n",
              "        (4): PerceiverLayer(\n",
              "          (attention): PerceiverAttention(\n",
              "            (self): PerceiverSelfAttention(\n",
              "              (layernorm1): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "              (layernorm2): Identity()\n",
              "              (query): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (key): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (value): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (dropout): Dropout(p=0.1, inplace=False)\n",
              "            )\n",
              "            (output): PerceiverSelfOutput(\n",
              "              (dense): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            )\n",
              "          )\n",
              "          (layernorm): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "          (mlp): PerceiverMLP(\n",
              "            (dense1): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            (dense2): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "          )\n",
              "        )\n",
              "        (5): PerceiverLayer(\n",
              "          (attention): PerceiverAttention(\n",
              "            (self): PerceiverSelfAttention(\n",
              "              (layernorm1): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "              (layernorm2): Identity()\n",
              "              (query): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (key): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (value): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (dropout): Dropout(p=0.1, inplace=False)\n",
              "            )\n",
              "            (output): PerceiverSelfOutput(\n",
              "              (dense): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            )\n",
              "          )\n",
              "          (layernorm): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "          (mlp): PerceiverMLP(\n",
              "            (dense1): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            (dense2): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "          )\n",
              "        )\n",
              "      )\n",
              "    )\n",
              "    (decoder): PerceiverClassificationDecoder(\n",
              "      (decoder): PerceiverBasicDecoder(\n",
              "        (output_position_encodings): PerceiverTrainablePositionEncoding()\n",
              "        (positions_projection): Identity()\n",
              "        (decoding_cross_attention): PerceiverLayer(\n",
              "          (attention): PerceiverAttention(\n",
              "            (self): PerceiverSelfAttention(\n",
              "              (layernorm1): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "              (layernorm2): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "              (query): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (key): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (value): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "              (dropout): Dropout(p=0.1, inplace=False)\n",
              "            )\n",
              "            (output): PerceiverSelfOutput(\n",
              "              (dense): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            )\n",
              "          )\n",
              "          (layernorm): LayerNorm((1024,), eps=1e-05, elementwise_affine=True)\n",
              "          (mlp): PerceiverMLP(\n",
              "            (dense1): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "            (dense2): Linear(in_features=1024, out_features=1024, bias=True)\n",
              "          )\n",
              "        )\n",
              "        (final_layer): Linear(in_features=1024, out_features=10, bias=True)\n",
              "      )\n",
              "    )\n",
              "  )\n",
              ")"
            ]
          },
          "metadata": {},
          "execution_count": 22
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "5L7lDhH40DPH"
      },
      "source": [
        "## Train the model\n",
        "\n",
        "Here we train the model using native PyTorch."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000,
          "referenced_widgets": [
            "431ce04341104413a241878d0a1bef85",
            "f21baad907a8402c819f0464b3e3a247",
            "c311ef2d3c1a4c43b76f9a0fbed71dcc",
            "bb830a6f272f40589a4b9539e3b5bf58",
            "fe9ae02806544e5497578368139c6375",
            "9cfaa9c8d2804fc2826e07d18e1e4af5",
            "a04f9527f29e4733b6e577fb1b20eb0a",
            "f2ad9419e97c436c82504c52e175e65f",
            "1765ce2d985a445da061f8634c1c2a6d",
            "c07e9b2c463b45eb936257395d8376cd",
            "e6982bddf0ec4151a7859ac54ed5bef0",
            "14f88ca20c50418b9bab7f4f439543a6",
            "04e9e01d43394aa8b5a7de930b804f70",
            "1335bfe672844219919dc613c76edc33",
            "17e3436f0d8843b8bea313f923662f95",
            "b179631432ad406d8ac3241837d494c2",
            "6fa7b93516374065806d3b7ca79df994",
            "9abf2e943dcf4fa08642ebfe123498f4",
            "376ebdb254cd4d5fa3e49c4bc24d61c6",
            "fed17776c9ea4d3684423fee9db060a6",
            "848d973f0822402dafd0332185948f52",
            "6c432c844ea9491eace4894bd8cb7a26"
          ]
        },
        "id": "mZrbMNre1bqs",
        "outputId": "c91bfde6-a3ba-4850-80fd-7c9b7a44a073"
      },
      "source": [
        "from transformers import AdamW\n",
        "from tqdm.notebook import tqdm\n",
        "from sklearn.metrics import accuracy_score\n",
        "\n",
        "optimizer = AdamW(model.parameters(), lr=5e-5)\n",
        "\n",
        "model.train()\n",
        "for epoch in range(2):  # loop over the dataset multiple times\n",
        "    print(\"Epoch:\", epoch)\n",
        "    for batch in tqdm(train_dataloader):\n",
        "         # get the inputs; \n",
        "         inputs = batch[\"pixel_values\"].to(device)\n",
        "         labels = batch[\"labels\"].to(device)\n",
        "\n",
        "         # zero the parameter gradients\n",
        "         optimizer.zero_grad()\n",
        "\n",
        "         # forward + backward + optimize\n",
        "         outputs = model(inputs=inputs, labels=labels)\n",
        "         loss = outputs.loss\n",
        "         loss.backward()\n",
        "         optimizer.step()\n",
        "\n",
        "         # evaluate\n",
        "         predictions = outputs.logits.argmax(-1).cpu().detach().numpy()\n",
        "         accuracy = accuracy_score(y_true=batch[\"labels\"].numpy(), y_pred=predictions)\n",
        "         print(f\"Loss: {loss.item()}, Accuracy: {accuracy}\")"
      ],
      "execution_count": 25,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Epoch: 0\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "431ce04341104413a241878d0a1bef85",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "  0%|          | 0/225 [00:00<?, ?it/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Loss: 2.6121115684509277, Accuracy: 0.0\n",
            "Loss: 2.087411642074585, Accuracy: 0.5\n",
            "Loss: 2.516732692718506, Accuracy: 0.0\n",
            "Loss: 2.915447950363159, Accuracy: 0.0\n",
            "Loss: 2.631737232208252, Accuracy: 0.0\n",
            "Loss: 2.2259626388549805, Accuracy: 0.5\n",
            "Loss: 2.619555950164795, Accuracy: 0.0\n",
            "Loss: 2.2871932983398438, Accuracy: 0.0\n",
            "Loss: 2.1763486862182617, Accuracy: 0.0\n",
            "Loss: 2.0308685302734375, Accuracy: 0.5\n",
            "Loss: 2.330275297164917, Accuracy: 0.0\n",
            "Loss: 1.7330862283706665, Accuracy: 1.0\n",
            "Loss: 2.094666004180908, Accuracy: 0.5\n",
            "Loss: 2.516792058944702, Accuracy: 0.0\n",
            "Loss: 1.8952770233154297, Accuracy: 0.5\n",
            "Loss: 2.5204763412475586, Accuracy: 0.0\n",
            "Loss: 1.9076743125915527, Accuracy: 0.5\n",
            "Loss: 1.8706510066986084, Accuracy: 0.5\n",
            "Loss: 1.2029504776000977, Accuracy: 1.0\n",
            "Loss: 2.11360764503479, Accuracy: 0.0\n",
            "Loss: 1.1523082256317139, Accuracy: 0.5\n",
            "Loss: 2.8178200721740723, Accuracy: 0.0\n",
            "Loss: 2.510197401046753, Accuracy: 0.0\n",
            "Loss: 2.008117198944092, Accuracy: 0.0\n",
            "Loss: 2.6826279163360596, Accuracy: 0.0\n",
            "Loss: 1.6611363887786865, Accuracy: 0.5\n",
            "Loss: 1.114955186843872, Accuracy: 1.0\n",
            "Loss: 2.625856876373291, Accuracy: 0.0\n",
            "Loss: 2.2276546955108643, Accuracy: 0.0\n",
            "Loss: 1.8992457389831543, Accuracy: 0.5\n",
            "Loss: 2.0746569633483887, Accuracy: 0.0\n",
            "Loss: 1.6502797603607178, Accuracy: 0.5\n",
            "Loss: 2.1183388233184814, Accuracy: 0.0\n",
            "Loss: 1.620215654373169, Accuracy: 0.5\n",
            "Loss: 1.2759671211242676, Accuracy: 1.0\n",
            "Loss: 1.8782074451446533, Accuracy: 0.5\n",
            "Loss: 2.0752434730529785, Accuracy: 0.5\n",
            "Loss: 1.6584246158599854, Accuracy: 0.5\n",
            "Loss: 1.247715711593628, Accuracy: 0.5\n",
            "Loss: 0.9574835300445557, Accuracy: 1.0\n",
            "Loss: 2.3619587421417236, Accuracy: 0.0\n",
            "Loss: 1.6862428188323975, Accuracy: 0.5\n",
            "Loss: 1.364986538887024, Accuracy: 0.5\n",
            "Loss: 1.1413238048553467, Accuracy: 1.0\n",
            "Loss: 1.0554171800613403, Accuracy: 0.5\n",
            "Loss: 1.7322996854782104, Accuracy: 0.5\n",
            "Loss: 2.3750545978546143, Accuracy: 0.0\n",
            "Loss: 1.026109218597412, Accuracy: 1.0\n",
            "Loss: 1.0658185482025146, Accuracy: 0.5\n",
            "Loss: 1.059452772140503, Accuracy: 1.0\n",
            "Loss: 1.1761549711227417, Accuracy: 0.5\n",
            "Loss: 0.3237268328666687, Accuracy: 1.0\n",
            "Loss: 1.6435303688049316, Accuracy: 0.0\n",
            "Loss: 1.2014448642730713, Accuracy: 1.0\n",
            "Loss: 0.9356918931007385, Accuracy: 0.5\n",
            "Loss: 1.7592103481292725, Accuracy: 0.5\n",
            "Loss: 0.6798020601272583, Accuracy: 1.0\n",
            "Loss: 1.1456916332244873, Accuracy: 0.5\n",
            "Loss: 1.5492641925811768, Accuracy: 0.5\n",
            "Loss: 0.41597074270248413, Accuracy: 1.0\n",
            "Loss: 1.843977689743042, Accuracy: 0.0\n",
            "Loss: 0.9931153059005737, Accuracy: 0.5\n",
            "Loss: 0.7718281745910645, Accuracy: 0.5\n",
            "Loss: 1.1033860445022583, Accuracy: 0.5\n",
            "Loss: 1.1949172019958496, Accuracy: 0.5\n",
            "Loss: 1.3252075910568237, Accuracy: 0.5\n",
            "Loss: 0.5001423358917236, Accuracy: 1.0\n",
            "Loss: 0.4095207750797272, Accuracy: 1.0\n",
            "Loss: 2.4796481132507324, Accuracy: 0.5\n",
            "Loss: 0.5394129157066345, Accuracy: 1.0\n",
            "Loss: 1.9998856782913208, Accuracy: 0.5\n",
            "Loss: 0.7869319915771484, Accuracy: 0.5\n",
            "Loss: 1.0271148681640625, Accuracy: 0.5\n",
            "Loss: 0.8831621408462524, Accuracy: 0.5\n",
            "Loss: 2.572192668914795, Accuracy: 0.5\n",
            "Loss: 0.0976964682340622, Accuracy: 1.0\n",
            "Loss: 0.022447261959314346, Accuracy: 1.0\n",
            "Loss: 1.0829637050628662, Accuracy: 0.5\n",
            "Loss: 0.008959445171058178, Accuracy: 1.0\n",
            "Loss: 2.0219714641571045, Accuracy: 0.0\n",
            "Loss: 1.7754820585250854, Accuracy: 0.5\n",
            "Loss: 0.839960515499115, Accuracy: 0.5\n",
            "Loss: 2.380335569381714, Accuracy: 0.5\n",
            "Loss: 2.0728542804718018, Accuracy: 0.5\n",
            "Loss: 1.5046677589416504, Accuracy: 0.5\n",
            "Loss: 0.3061242699623108, Accuracy: 1.0\n",
            "Loss: 2.9649319648742676, Accuracy: 0.5\n",
            "Loss: 1.6965539455413818, Accuracy: 0.0\n",
            "Loss: 1.4031859636306763, Accuracy: 0.5\n",
            "Loss: 0.3697934150695801, Accuracy: 1.0\n",
            "Loss: 2.266505241394043, Accuracy: 0.0\n",
            "Loss: 1.8001315593719482, Accuracy: 0.5\n",
            "Loss: 0.9849446415901184, Accuracy: 0.5\n",
            "Loss: 1.8010939359664917, Accuracy: 0.5\n",
            "Loss: 1.430918574333191, Accuracy: 0.5\n",
            "Loss: 1.8794136047363281, Accuracy: 0.5\n",
            "Loss: 2.0037171840667725, Accuracy: 0.5\n",
            "Loss: 1.0590156316757202, Accuracy: 0.5\n",
            "Loss: 0.2737025022506714, Accuracy: 1.0\n",
            "Loss: 1.260535478591919, Accuracy: 1.0\n",
            "Loss: 0.9519355297088623, Accuracy: 0.5\n",
            "Loss: 0.9175679683685303, Accuracy: 0.5\n",
            "Loss: 1.3700668811798096, Accuracy: 0.5\n",
            "Loss: 0.36501938104629517, Accuracy: 1.0\n",
            "Loss: 1.891088843345642, Accuracy: 0.0\n",
            "Loss: 1.2195643186569214, Accuracy: 0.5\n",
            "Loss: 0.7871502637863159, Accuracy: 0.5\n",
            "Loss: 1.947049856185913, Accuracy: 0.0\n",
            "Loss: 2.5513763427734375, Accuracy: 0.0\n",
            "Loss: 0.8383434414863586, Accuracy: 1.0\n",
            "Loss: 0.45489370822906494, Accuracy: 1.0\n",
            "Loss: 1.5892095565795898, Accuracy: 0.5\n",
            "Loss: 1.082730770111084, Accuracy: 0.5\n",
            "Loss: 2.1865272521972656, Accuracy: 0.5\n",
            "Loss: 1.4873603582382202, Accuracy: 0.0\n",
            "Loss: 0.7336676716804504, Accuracy: 0.5\n",
            "Loss: 1.7084957361221313, Accuracy: 0.5\n",
            "Loss: 0.4768260717391968, Accuracy: 1.0\n",
            "Loss: 0.4554026424884796, Accuracy: 1.0\n",
            "Loss: 0.8393226265907288, Accuracy: 1.0\n",
            "Loss: 0.30985239148139954, Accuracy: 1.0\n",
            "Loss: 0.367684930562973, Accuracy: 1.0\n",
            "Loss: 0.3011043667793274, Accuracy: 1.0\n",
            "Loss: 0.07714685052633286, Accuracy: 1.0\n",
            "Loss: 0.45998844504356384, Accuracy: 1.0\n",
            "Loss: 1.7211207151412964, Accuracy: 0.5\n",
            "Loss: 1.1146544218063354, Accuracy: 0.5\n",
            "Loss: 0.6121867299079895, Accuracy: 1.0\n",
            "Loss: 0.42066124081611633, Accuracy: 1.0\n",
            "Loss: 0.14402402937412262, Accuracy: 1.0\n",
            "Loss: 0.047435976564884186, Accuracy: 1.0\n",
            "Loss: 2.1953189373016357, Accuracy: 0.5\n",
            "Loss: 0.3963087797164917, Accuracy: 1.0\n",
            "Loss: 2.1742444038391113, Accuracy: 0.0\n",
            "Loss: 4.315773010253906, Accuracy: 0.5\n",
            "Loss: 0.15694475173950195, Accuracy: 1.0\n",
            "Loss: 0.020498551428318024, Accuracy: 1.0\n",
            "Loss: 0.3274359107017517, Accuracy: 1.0\n",
            "Loss: 0.6870551705360413, Accuracy: 0.5\n",
            "Loss: 0.7821224331855774, Accuracy: 0.5\n",
            "Loss: 1.6701990365982056, Accuracy: 0.5\n",
            "Loss: 0.040285199880599976, Accuracy: 1.0\n",
            "Loss: 3.591796398162842, Accuracy: 0.5\n",
            "Loss: 0.6215171217918396, Accuracy: 0.5\n",
            "Loss: 0.8734002113342285, Accuracy: 0.5\n",
            "Loss: 1.1335740089416504, Accuracy: 0.5\n",
            "Loss: 0.5234683752059937, Accuracy: 0.5\n",
            "Loss: 1.6105177402496338, Accuracy: 0.5\n",
            "Loss: 0.8842145800590515, Accuracy: 0.5\n",
            "Loss: 0.4685503840446472, Accuracy: 1.0\n",
            "Loss: 1.6452642679214478, Accuracy: 0.0\n",
            "Loss: 1.5221103429794312, Accuracy: 0.5\n",
            "Loss: 1.4392192363739014, Accuracy: 0.5\n",
            "Loss: 2.3469595909118652, Accuracy: 0.5\n",
            "Loss: 0.9503792524337769, Accuracy: 0.5\n",
            "Loss: 0.6442641615867615, Accuracy: 1.0\n",
            "Loss: 0.14783944189548492, Accuracy: 1.0\n",
            "Loss: 2.9989242553710938, Accuracy: 0.0\n",
            "Loss: 0.40159159898757935, Accuracy: 1.0\n",
            "Loss: 1.1750147342681885, Accuracy: 0.5\n",
            "Loss: 0.40470531582832336, Accuracy: 1.0\n",
            "Loss: 2.3558802604675293, Accuracy: 0.0\n",
            "Loss: 2.0360841751098633, Accuracy: 0.0\n",
            "Loss: 0.0974763035774231, Accuracy: 1.0\n",
            "Loss: 0.3338206708431244, Accuracy: 1.0\n",
            "Loss: 1.178271770477295, Accuracy: 0.5\n",
            "Loss: 0.1265433132648468, Accuracy: 1.0\n",
            "Loss: 0.9737707376480103, Accuracy: 0.5\n",
            "Loss: 1.0399127006530762, Accuracy: 0.5\n",
            "Loss: 2.482410192489624, Accuracy: 0.0\n",
            "Loss: 0.053663309663534164, Accuracy: 1.0\n",
            "Loss: 0.5514419078826904, Accuracy: 1.0\n",
            "Loss: 1.1057102680206299, Accuracy: 0.5\n",
            "Loss: 0.5346415638923645, Accuracy: 1.0\n",
            "Loss: 0.9370553493499756, Accuracy: 0.5\n",
            "Loss: 1.591621994972229, Accuracy: 0.5\n",
            "Loss: 0.09926620870828629, Accuracy: 1.0\n",
            "Loss: 0.20583921670913696, Accuracy: 1.0\n",
            "Loss: 0.13775402307510376, Accuracy: 1.0\n",
            "Loss: 1.4291856288909912, Accuracy: 0.0\n",
            "Loss: 1.7908406257629395, Accuracy: 0.5\n",
            "Loss: 0.8051873445510864, Accuracy: 1.0\n",
            "Loss: 0.425130158662796, Accuracy: 1.0\n",
            "Loss: 0.10175332427024841, Accuracy: 1.0\n",
            "Loss: 0.3101627230644226, Accuracy: 1.0\n",
            "Loss: 0.7848129272460938, Accuracy: 1.0\n",
            "Loss: 0.8362638354301453, Accuracy: 0.5\n",
            "Loss: 1.513977289199829, Accuracy: 0.5\n",
            "Loss: 2.5639383792877197, Accuracy: 0.0\n",
            "Loss: 1.3154902458190918, Accuracy: 0.5\n",
            "Loss: 0.4841958284378052, Accuracy: 1.0\n",
            "Loss: 0.09126108139753342, Accuracy: 1.0\n",
            "Loss: 0.9045900702476501, Accuracy: 0.5\n",
            "Loss: 1.8348228931427002, Accuracy: 0.0\n",
            "Loss: 1.9100027084350586, Accuracy: 0.5\n",
            "Loss: 0.10081572830677032, Accuracy: 1.0\n",
            "Loss: 0.09020127356052399, Accuracy: 1.0\n",
            "Loss: 1.616969347000122, Accuracy: 0.5\n",
            "Loss: 0.07141739130020142, Accuracy: 1.0\n",
            "Loss: 0.08505327254533768, Accuracy: 1.0\n",
            "Loss: 0.3519690930843353, Accuracy: 1.0\n",
            "Loss: 0.5652232766151428, Accuracy: 1.0\n",
            "Loss: 0.7854887247085571, Accuracy: 0.5\n",
            "Loss: 1.2910178899765015, Accuracy: 0.5\n",
            "Loss: 0.006767139304429293, Accuracy: 1.0\n",
            "Loss: 0.1896212100982666, Accuracy: 1.0\n",
            "Loss: 2.517543315887451, Accuracy: 0.5\n",
            "Loss: 0.14876827597618103, Accuracy: 1.0\n",
            "Loss: 0.07295934855937958, Accuracy: 1.0\n",
            "Loss: 1.930787444114685, Accuracy: 0.5\n",
            "Loss: 3.113680601119995, Accuracy: 0.5\n",
            "Loss: 0.032554470002651215, Accuracy: 1.0\n",
            "Loss: 0.03497377783060074, Accuracy: 1.0\n",
            "Loss: 0.7345528602600098, Accuracy: 0.5\n",
            "Loss: 0.019543008878827095, Accuracy: 1.0\n",
            "Loss: 0.2283167690038681, Accuracy: 1.0\n",
            "Loss: 1.4983279705047607, Accuracy: 0.5\n",
            "Loss: 0.10402748733758926, Accuracy: 1.0\n",
            "Loss: 0.03819054365158081, Accuracy: 1.0\n",
            "Loss: 0.21785996854305267, Accuracy: 1.0\n",
            "Loss: 0.2946622371673584, Accuracy: 1.0\n",
            "Loss: 0.8052353262901306, Accuracy: 0.5\n",
            "Loss: 0.17693811655044556, Accuracy: 1.0\n",
            "Loss: 1.1217429637908936, Accuracy: 0.5\n",
            "Loss: 0.11008389294147491, Accuracy: 1.0\n",
            "Epoch: 1\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "14f88ca20c50418b9bab7f4f439543a6",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "  0%|          | 0/225 [00:00<?, ?it/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Loss: 0.2511093020439148, Accuracy: 1.0\n",
            "Loss: 0.20040327310562134, Accuracy: 1.0\n",
            "Loss: 0.056868888437747955, Accuracy: 1.0\n",
            "Loss: 0.0975453332066536, Accuracy: 1.0\n",
            "Loss: 1.1249535083770752, Accuracy: 0.5\n",
            "Loss: 0.04263799637556076, Accuracy: 1.0\n",
            "Loss: 0.3301231861114502, Accuracy: 1.0\n",
            "Loss: 2.047173023223877, Accuracy: 0.0\n",
            "Loss: 0.3231906592845917, Accuracy: 1.0\n",
            "Loss: 0.4727799892425537, Accuracy: 1.0\n",
            "Loss: 0.06914356350898743, Accuracy: 1.0\n",
            "Loss: 0.20520082116127014, Accuracy: 1.0\n",
            "Loss: 0.0944804772734642, Accuracy: 1.0\n",
            "Loss: 0.1908605694770813, Accuracy: 1.0\n",
            "Loss: 0.06819569319486618, Accuracy: 1.0\n",
            "Loss: 0.058507561683654785, Accuracy: 1.0\n",
            "Loss: 0.030860979110002518, Accuracy: 1.0\n",
            "Loss: 0.04331466555595398, Accuracy: 1.0\n",
            "Loss: 1.1817548274993896, Accuracy: 0.5\n",
            "Loss: 0.07851042598485947, Accuracy: 1.0\n",
            "Loss: 0.01915682852268219, Accuracy: 1.0\n",
            "Loss: 0.07248327136039734, Accuracy: 1.0\n",
            "Loss: 0.1211576983332634, Accuracy: 1.0\n",
            "Loss: 0.10418497025966644, Accuracy: 1.0\n",
            "Loss: 0.04465044289827347, Accuracy: 1.0\n",
            "Loss: 0.8819456100463867, Accuracy: 0.5\n",
            "Loss: 0.05764169245958328, Accuracy: 1.0\n",
            "Loss: 1.0934579372406006, Accuracy: 0.5\n",
            "Loss: 0.009219623170793056, Accuracy: 1.0\n",
            "Loss: 0.011632475070655346, Accuracy: 1.0\n",
            "Loss: 0.35532087087631226, Accuracy: 1.0\n",
            "Loss: 0.042637988924980164, Accuracy: 1.0\n",
            "Loss: 0.008953345939517021, Accuracy: 1.0\n",
            "Loss: 0.3509494364261627, Accuracy: 1.0\n",
            "Loss: 0.004778211936354637, Accuracy: 1.0\n",
            "Loss: 0.17400646209716797, Accuracy: 1.0\n",
            "Loss: 0.1133597269654274, Accuracy: 1.0\n",
            "Loss: 0.0026378065813332796, Accuracy: 1.0\n",
            "Loss: 0.009371727705001831, Accuracy: 1.0\n",
            "Loss: 1.6080747842788696, Accuracy: 0.5\n",
            "Loss: 0.004654253832995892, Accuracy: 1.0\n",
            "Loss: 0.025105275213718414, Accuracy: 1.0\n",
            "Loss: 0.2677434980869293, Accuracy: 1.0\n",
            "Loss: 0.03299786522984505, Accuracy: 1.0\n",
            "Loss: 0.02399725839495659, Accuracy: 1.0\n",
            "Loss: 0.015448583289980888, Accuracy: 1.0\n",
            "Loss: 0.05248412489891052, Accuracy: 1.0\n",
            "Loss: 0.07761542499065399, Accuracy: 1.0\n",
            "Loss: 0.6763821840286255, Accuracy: 1.0\n",
            "Loss: 0.01568794809281826, Accuracy: 1.0\n",
            "Loss: 0.029115093871951103, Accuracy: 1.0\n",
            "Loss: 0.08277803659439087, Accuracy: 1.0\n",
            "Loss: 0.4159071445465088, Accuracy: 1.0\n",
            "Loss: 0.46451669931411743, Accuracy: 1.0\n",
            "Loss: 0.0014588083140552044, Accuracy: 1.0\n",
            "Loss: 3.2164931297302246, Accuracy: 0.0\n",
            "Loss: 0.0009676195913925767, Accuracy: 1.0\n",
            "Loss: 0.04399682953953743, Accuracy: 1.0\n",
            "Loss: 1.0170631408691406, Accuracy: 0.5\n",
            "Loss: 0.0024331684689968824, Accuracy: 1.0\n",
            "Loss: 0.01990112103521824, Accuracy: 1.0\n",
            "Loss: 0.007506657857447863, Accuracy: 1.0\n",
            "Loss: 0.1043771356344223, Accuracy: 1.0\n",
            "Loss: 0.005224859807640314, Accuracy: 1.0\n",
            "Loss: 0.7643475532531738, Accuracy: 0.5\n",
            "Loss: 0.09488694369792938, Accuracy: 1.0\n",
            "Loss: 0.40570297837257385, Accuracy: 1.0\n",
            "Loss: 0.18263858556747437, Accuracy: 1.0\n",
            "Loss: 0.02140038087964058, Accuracy: 1.0\n",
            "Loss: 0.001103084534406662, Accuracy: 1.0\n",
            "Loss: 0.009099988266825676, Accuracy: 1.0\n",
            "Loss: 0.03315092623233795, Accuracy: 1.0\n",
            "Loss: 0.005270477384328842, Accuracy: 1.0\n",
            "Loss: 0.4508528411388397, Accuracy: 1.0\n",
            "Loss: 0.004161601886153221, Accuracy: 1.0\n",
            "Loss: 0.016137534752488136, Accuracy: 1.0\n",
            "Loss: 0.006646353751420975, Accuracy: 1.0\n",
            "Loss: 0.16938963532447815, Accuracy: 1.0\n",
            "Loss: 0.0029585964512079954, Accuracy: 1.0\n",
            "Loss: 0.2978248596191406, Accuracy: 1.0\n",
            "Loss: 0.02531919814646244, Accuracy: 1.0\n",
            "Loss: 0.01986038126051426, Accuracy: 1.0\n",
            "Loss: 0.05412628501653671, Accuracy: 1.0\n",
            "Loss: 0.36461183428764343, Accuracy: 1.0\n",
            "Loss: 0.3043355345726013, Accuracy: 1.0\n",
            "Loss: 0.012551749125123024, Accuracy: 1.0\n",
            "Loss: 0.6964491009712219, Accuracy: 0.5\n",
            "Loss: 0.09333339333534241, Accuracy: 1.0\n",
            "Loss: 0.23028013110160828, Accuracy: 1.0\n",
            "Loss: 0.11644624173641205, Accuracy: 1.0\n",
            "Loss: 0.11723023653030396, Accuracy: 1.0\n",
            "Loss: 0.0019451905973255634, Accuracy: 1.0\n",
            "Loss: 0.04732118546962738, Accuracy: 1.0\n",
            "Loss: 0.01961061917245388, Accuracy: 1.0\n",
            "Loss: 0.0012411507777869701, Accuracy: 1.0\n",
            "Loss: 0.09657786041498184, Accuracy: 1.0\n",
            "Loss: 0.022873062640428543, Accuracy: 1.0\n",
            "Loss: 0.9117152690887451, Accuracy: 0.5\n",
            "Loss: 1.4898251295089722, Accuracy: 0.5\n",
            "Loss: 0.579595148563385, Accuracy: 0.5\n",
            "Loss: 0.33736294507980347, Accuracy: 1.0\n",
            "Loss: 0.03991979733109474, Accuracy: 1.0\n",
            "Loss: 0.0039765313267707825, Accuracy: 1.0\n",
            "Loss: 0.12280268967151642, Accuracy: 1.0\n",
            "Loss: 0.0333278626203537, Accuracy: 1.0\n",
            "Loss: 0.0017811083234846592, Accuracy: 1.0\n",
            "Loss: 0.019173698499798775, Accuracy: 1.0\n",
            "Loss: 0.4017033576965332, Accuracy: 0.5\n",
            "Loss: 0.010247781872749329, Accuracy: 1.0\n",
            "Loss: 0.016507094725966454, Accuracy: 1.0\n",
            "Loss: 0.006378322374075651, Accuracy: 1.0\n",
            "Loss: 0.37420031428337097, Accuracy: 1.0\n",
            "Loss: 0.01754937693476677, Accuracy: 1.0\n",
            "Loss: 0.0005689432728104293, Accuracy: 1.0\n",
            "Loss: 1.1509532928466797, Accuracy: 0.5\n",
            "Loss: 0.33096396923065186, Accuracy: 1.0\n",
            "Loss: 0.3655981123447418, Accuracy: 0.5\n",
            "Loss: 0.2953057885169983, Accuracy: 1.0\n",
            "Loss: 0.3304053246974945, Accuracy: 1.0\n",
            "Loss: 0.03772229701280594, Accuracy: 1.0\n",
            "Loss: 0.09110715985298157, Accuracy: 1.0\n",
            "Loss: 0.005334870424121618, Accuracy: 1.0\n",
            "Loss: 0.09409358352422714, Accuracy: 1.0\n",
            "Loss: 0.11810111254453659, Accuracy: 1.0\n",
            "Loss: 0.09318800270557404, Accuracy: 1.0\n",
            "Loss: 0.028754763305187225, Accuracy: 1.0\n",
            "Loss: 2.427309036254883, Accuracy: 0.5\n",
            "Loss: 3.900348663330078, Accuracy: 0.5\n",
            "Loss: 0.18054375052452087, Accuracy: 1.0\n",
            "Loss: 0.03924167528748512, Accuracy: 1.0\n",
            "Loss: 0.006841880735009909, Accuracy: 1.0\n",
            "Loss: 0.05430324748158455, Accuracy: 1.0\n",
            "Loss: 0.746993362903595, Accuracy: 0.5\n",
            "Loss: 1.7399513721466064, Accuracy: 0.5\n",
            "Loss: 0.15964868664741516, Accuracy: 1.0\n",
            "Loss: 0.5865866541862488, Accuracy: 1.0\n",
            "Loss: 0.007254984229803085, Accuracy: 1.0\n",
            "Loss: 0.4937514662742615, Accuracy: 1.0\n",
            "Loss: 0.9517074227333069, Accuracy: 0.5\n",
            "Loss: 0.05954895168542862, Accuracy: 1.0\n",
            "Loss: 0.49962711334228516, Accuracy: 0.5\n",
            "Loss: 0.16558101773262024, Accuracy: 1.0\n",
            "Loss: 0.008007940836250782, Accuracy: 1.0\n",
            "Loss: 0.27541789412498474, Accuracy: 1.0\n",
            "Loss: 0.0007579841767437756, Accuracy: 1.0\n",
            "Loss: 0.020098822191357613, Accuracy: 1.0\n",
            "Loss: 0.006593924015760422, Accuracy: 1.0\n",
            "Loss: 0.019116992130875587, Accuracy: 1.0\n",
            "Loss: 0.08854177594184875, Accuracy: 1.0\n",
            "Loss: 0.2286490797996521, Accuracy: 1.0\n",
            "Loss: 0.007873299531638622, Accuracy: 1.0\n",
            "Loss: 0.06680022925138474, Accuracy: 1.0\n",
            "Loss: 0.13344407081604004, Accuracy: 1.0\n",
            "Loss: 0.1554102599620819, Accuracy: 1.0\n",
            "Loss: 0.006952513940632343, Accuracy: 1.0\n",
            "Loss: 2.4372284412384033, Accuracy: 0.5\n",
            "Loss: 0.004145563114434481, Accuracy: 1.0\n",
            "Loss: 0.7333663702011108, Accuracy: 0.5\n",
            "Loss: 2.1750783920288086, Accuracy: 0.5\n",
            "Loss: 0.3710911273956299, Accuracy: 1.0\n",
            "Loss: 0.05076193809509277, Accuracy: 1.0\n",
            "Loss: 2.554433584213257, Accuracy: 0.5\n",
            "Loss: 0.018577057868242264, Accuracy: 1.0\n",
            "Loss: 6.254937171936035, Accuracy: 0.5\n",
            "Loss: 0.12407036870718002, Accuracy: 1.0\n",
            "Loss: 0.09037812799215317, Accuracy: 1.0\n",
            "Loss: 0.6982030868530273, Accuracy: 0.5\n",
            "Loss: 0.327933669090271, Accuracy: 1.0\n",
            "Loss: 0.8809948563575745, Accuracy: 0.5\n",
            "Loss: 0.046591974794864655, Accuracy: 1.0\n",
            "Loss: 0.08191364258527756, Accuracy: 1.0\n",
            "Loss: 0.021856902167201042, Accuracy: 1.0\n",
            "Loss: 1.2363420724868774, Accuracy: 0.5\n",
            "Loss: 0.10897770524024963, Accuracy: 1.0\n",
            "Loss: 0.04321807995438576, Accuracy: 1.0\n",
            "Loss: 1.0153006315231323, Accuracy: 0.5\n",
            "Loss: 4.015501022338867, Accuracy: 0.5\n",
            "Loss: 1.9290798902511597, Accuracy: 0.5\n",
            "Loss: 0.4641894996166229, Accuracy: 0.5\n",
            "Loss: 0.5931834578514099, Accuracy: 0.5\n",
            "Loss: 0.8370879292488098, Accuracy: 0.5\n",
            "Loss: 0.014984546229243279, Accuracy: 1.0\n",
            "Loss: 1.6202900409698486, Accuracy: 0.5\n",
            "Loss: 2.015481948852539, Accuracy: 0.0\n",
            "Loss: 2.9919464588165283, Accuracy: 0.5\n",
            "Loss: 2.914574384689331, Accuracy: 0.0\n",
            "Loss: 0.10364090651273727, Accuracy: 1.0\n",
            "Loss: 0.4263947606086731, Accuracy: 1.0\n",
            "Loss: 2.433713912963867, Accuracy: 0.5\n",
            "Loss: 0.8894574642181396, Accuracy: 0.5\n",
            "Loss: 0.7192734479904175, Accuracy: 1.0\n",
            "Loss: 0.268726110458374, Accuracy: 1.0\n",
            "Loss: 2.400543212890625, Accuracy: 0.0\n",
            "Loss: 2.1654512882232666, Accuracy: 0.0\n",
            "Loss: 1.3491528034210205, Accuracy: 1.0\n",
            "Loss: 1.02764892578125, Accuracy: 1.0\n",
            "Loss: 1.1799770593643188, Accuracy: 1.0\n",
            "Loss: 1.5760068893432617, Accuracy: 0.5\n",
            "Loss: 1.149863362312317, Accuracy: 0.5\n",
            "Loss: 2.1885266304016113, Accuracy: 0.0\n",
            "Loss: 2.526496410369873, Accuracy: 0.0\n",
            "Loss: 1.3135685920715332, Accuracy: 0.5\n",
            "Loss: 0.6133153438568115, Accuracy: 1.0\n",
            "Loss: 0.8389273881912231, Accuracy: 1.0\n",
            "Loss: 0.11448832601308823, Accuracy: 1.0\n",
            "Loss: 0.721856415271759, Accuracy: 0.5\n",
            "Loss: 0.1595064103603363, Accuracy: 1.0\n",
            "Loss: 0.8644488453865051, Accuracy: 0.5\n",
            "Loss: 0.20284141600131989, Accuracy: 1.0\n",
            "Loss: 1.2518157958984375, Accuracy: 0.5\n",
            "Loss: 0.24228094518184662, Accuracy: 1.0\n",
            "Loss: 2.2380013465881348, Accuracy: 0.5\n",
            "Loss: 2.3450706005096436, Accuracy: 0.0\n",
            "Loss: 1.2858304977416992, Accuracy: 0.5\n",
            "Loss: 1.6374441385269165, Accuracy: 0.5\n",
            "Loss: 0.7049791812896729, Accuracy: 1.0\n",
            "Loss: 0.908236026763916, Accuracy: 0.5\n",
            "Loss: 0.17991206049919128, Accuracy: 1.0\n",
            "Loss: 0.12053491920232773, Accuracy: 1.0\n",
            "Loss: 0.4003455936908722, Accuracy: 1.0\n",
            "Loss: 0.47193825244903564, Accuracy: 1.0\n",
            "Loss: 0.07643316686153412, Accuracy: 1.0\n",
            "Loss: 0.09613324701786041, Accuracy: 1.0\n",
            "Loss: 0.015782656148076057, Accuracy: 1.0\n",
            "Loss: 0.28067082166671753, Accuracy: 1.0\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "YcsR-ct94W1h"
      },
      "source": [
        "## Evaluate the model\n",
        "\n",
        "Finally, we evaluate the model on the test set. We use the Datasets library to compute the accuracy.\n",
        "\n",
        "On some runs, I got 78%, then 66%. Of course, one would need to train on the entire dataset to achieve great results."
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 66,
          "referenced_widgets": [
            "95921ef023eb4398b5d07dd3541f50c0",
            "690fc0996ddf447d8e455ff487a3f29d",
            "4f6430e6948b4886a870926ac0543700",
            "f55f397abefa4bf88ead5de3cb3ae388",
            "501067db0a784e4eaac966717c618b84",
            "ad8744b246914633bb88cd2688d07bc5",
            "0c049e8291834040808c840a8977d772",
            "ce7f9575525443ce97fb133be2805b5c",
            "7b227fb0b8c24802a86349047f9d52ed",
            "dffd00dbe9294289834632c502ae5e2c",
            "d46a9599c9f84adc9595312f150b3c85"
          ]
        },
        "id": "wkQjXLMx2ZJn",
        "outputId": "22f04b97-51c5-411b-adcc-f83eaa669064"
      },
      "source": [
        "from tqdm.notebook import tqdm\n",
        "from datasets import load_metric\n",
        "\n",
        "accuracy = load_metric(\"accuracy\")\n",
        "\n",
        "model.eval()\n",
        "for batch in tqdm(val_dataloader):\n",
        "      # get the inputs; \n",
        "      inputs = batch[\"pixel_values\"].to(device)\n",
        "      labels = batch[\"labels\"].to(device)\n",
        "\n",
        "      # forward pass\n",
        "      outputs = model(inputs=inputs, labels=labels)\n",
        "      logits = outputs.logits \n",
        "      predictions = logits.argmax(-1).cpu().detach().numpy()\n",
        "      references = batch[\"labels\"].numpy()\n",
        "      accuracy.add_batch(predictions=predictions, references=references)\n",
        "\n",
        "final_score = accuracy.compute()\n",
        "print(\"Accuracy on test set:\", final_score)"
      ],
      "execution_count": 27,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "application/vnd.jupyter.widget-view+json": {
              "model_id": "95921ef023eb4398b5d07dd3541f50c0",
              "version_minor": 0,
              "version_major": 2
            },
            "text/plain": [
              "  0%|          | 0/25 [00:00<?, ?it/s]"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Accuracy on test set: {'accuracy': 0.74}\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "iAzNmSvy56bY"
      },
      "source": [
        ""
      ],
      "execution_count": null,
      "outputs": []
    }
  ]
}